/************************************************************************
 * @user wxl
 * @date 2016/2/28
 * @description  解析组件或者后期讲的布局
 *************************************************************************
 * @copyright by wh  可以提供开源，但如果引用代码需标明出处
 ************************************************************************/
;(function(NS,$){
     var _parseAttribute = function(jQueryNode,attrName){
         var jsonObjAttr = {};
         var jsonStringAttr = jQueryNode.attr(attrName);
         if(jsonStringAttr){
             try{
                 jsonObjAttr = JSON.parse(jsonStringAttr.replace(/'/g, '"'))
             }catch (e)
             {
                 console.error("error occurred when parse attribute = '" + attrName + "' in html," +
                     "please check the jsonString:" + jsonStringAttr);
             }
         }
         return jsonObjAttr;
     }

    var _parseWidget = function(){
        var widgetAttrTag = "ui-widget-attr";
        //parse Navigation
        $("div[ui-widget-type='Notification']").each(function(){
            var attributes = _parseAttribute($(this),widgetAttrTag);
            attributes["element"] = $(this)[0];
            NS.Notification(attributes);
        });
    }

    NS.initPage = function(){
       _parseWidget();
        NS.Notification();
    }
})(wh.ui,$);